Skip to content

Update_homework_1.md#1

Open
AdithyaLab wants to merge 10 commits intomainfrom
homework
Open

Update_homework_1.md#1
AdithyaLab wants to merge 10 commits intomainfrom
homework

Conversation

@AdithyaLab
Copy link
Owner

Added logical data model at the top and bottom of the md file for product and customer_purchases tables

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Added logical data model at the top and bottom of the md file for product and customer_purchases tables. Wasn't sure exactly where to put it in the file :)

What did you learn from the changes you have made?
how to build a logical data model from reviewing the table and content files on BD browser

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Used microsoft products to build model. Was considering Draw and Lucid

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
No

How were these changes tested?
Tried it in incognito mode to make sure the photo opened up for public

A reference to a related issue in your repository (if applicable)
NA

Checklist
[X ] I can confirm that my changes are working as intended

Added logical data model at the top and bottom of the md file for product and customer_purchases tables
Copy link

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!
8/8

Completed queries requested
@AdithyaLab
Copy link
Owner Author

homework_2.sql submitted on same branch. Please review.

updated sql file by adding queries to the questions.
@AdithyaLab
Copy link
Owner Author

homework_3.sql submitted on same branch. @amanda-ng518 - please review homework two and three solution provided. Please also comment here if I am submitting homework two and three correctly by using the same pull request? Thank you :)

Copy link

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HW2: 8/8

Copy link

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HW3: good job
8/8

@AdithyaLab
Copy link
Owner Author

Homework_4.sql completed. @amanda-ng518

Copy link

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HW4: good
8/8

Completed code solutions for questions. Not able to complete the last question, Too hard :(
@AdithyaLab
Copy link
Owner Author

Homework_5.sql completed. I can't do the last question. Too hard! @amanda-ng518

Reflected on my previous work and how I would adjust to include ethics and inequity components
@AdithyaLab
Copy link
Owner Author

Homework_6.md completed. @amanda-ng518

Copy link

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HW5: 8/8
INSERT Q2 missing SELECT, FROM and WHERE statements
UPDATE Q1
ALTER TABLE product_units
ADD current_quantity INT;
UPDATE product_units
SET current_quantity = (
SELECT current_quantity
FROM (
SELECT p.product_id, COALESCE(quantity,0) as current_quantity
FROM product_units p
LEFT JOIN (
SELECT *
,ROW_NUMBER() OVER( PARTITION BY vi.product_id ORDER BY market_date DESC) AS rn
FROM vendor_inventory vi
) vi ON p.product_id = vi.product_id
WHERE rn = 1
OR rn IS NULL
) p
WHERE product_units.product_id = p.product_id);

Copy link

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HW6: 8/8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants